package com.ibm.cps.jarxs;

import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HeaderParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;

@Path(ParaUtility.Processor)
public interface ProcessorResource {

//	GET /Processors/<tenantId>		//list
//	GET /Processors/<tenantId>?q=…[&type=…]
//	GET /Processors/<tenantId>?datasource=…[&type=node-red/sql]
//	GET /Processors/<tenantId>?publisher=…[&type=…]
	@GET
	@Path(ParaUtility.TenantFormat)
	Response GetProcessors(@PathParam(ParaUtility.TenantField) String tenantid,@Context UriInfo info,
			@HeaderParam(ParaUtility.auth) String key);
	
//	GET /Processors/<tenantId>/<groupId>	//list
//	GET /Processors/<tenantId>/<groupId>?q=…
//	GET /Processors/<tenantId>/<groupId>?processorType=rule
	@GET
	@Path(ParaUtility.TenantFormat + "/" + ParaUtility.Group_format)
	Response GetProcessor(@PathParam(ParaUtility.TenantField) String tenantid,
			@PathParam(ParaUtility.Group_field) String groupid ,@Context UriInfo info,
			@HeaderParam(ParaUtility.auth) String key);

	
//	PUT /Processors/<tenantId>/<groupId>?type=sql
//	PUT /Processors/<tenantId>/<groupId>?type=node-red
//	PUT /Processors/<tenantId>/<groupId>/<processorId>
//		update only, failure on non-existence
	@PUT
	@Path(ParaUtility.TenantFormat + "/" + ParaUtility.Group_format)
	Response PutProcessors(@PathParam(ParaUtility.TenantField) String tenantid,
			@PathParam(ParaUtility.Group_field)  String groupid,@Context UriInfo info,String json,
			@HeaderParam(ParaUtility.auth) String key);
	

//			POST /Processors/<tenantId>?type=sql
//			POST /Processors/<tenantId>?type=node-red
	@POST
	@Path(ParaUtility.TenantFormat)
	Response PostProcessors(@PathParam(ParaUtility.TenantField) String tenantid,
			@Context UriInfo info,String json,
			@HeaderParam(ParaUtility.auth) String key);

//			DELETE /Processors/<tenantId>?
	@DELETE
	@Path(ParaUtility.TenantFormat)
	Response DeleteProcessors(@PathParam(ParaUtility.TenantField) String tenantid,
			@HeaderParam(ParaUtility.auth) String key);

//	DELETE /Processors/<tenantId>/<groupId>
	@DELETE
	@Path(ParaUtility.TenantFormat + "/" + ParaUtility.Group_format)
	Response DeleteProcessor(@PathParam(ParaUtility.TenantField) String tenantid,
			@PathParam(ParaUtility.Group_field) String groupid,
			@HeaderParam(ParaUtility.auth) String key);
	
//	DELETE /Processors/<tenantId>/<groupId>/<processorId>
	@DELETE
	@Path(ParaUtility.TenantFormat + "/" + ParaUtility.Group_format + "/" + ParaUtility.Processor_format)
	Response DeleteProcessor(@PathParam(ParaUtility.TenantField) String tenantid,
			@PathParam(ParaUtility.Group_field) String groupid,
			@PathParam(ParaUtility.Processor_field) String processor,
			@HeaderParam(ParaUtility.auth) String key);
	
}
